package com.third.share.umeng.sina;

import android.app.Activity;

import com.dg.acb.utils.configdata.XXConstants;
import com.third.login.ThirdLoginPlatform;
import com.third.share.ShareData;
import com.third.share.umeng.Defaultcontent;
import com.third.share.umeng.StyleUtil;
import com.third.share.umeng.UMThirdShareBase;
import com.umeng.socialize.PlatformConfig;
import com.umeng.socialize.ShareAction;
import com.umeng.socialize.bean.SHARE_MEDIA;
public class USinaThirdShare extends UMThirdShareBase {

	public USinaThirdShare(Activity act) {
		super(act);
		// TODO Auto-generated constructor stub
	}

	protected void init(){
		mPlatform = ThirdLoginPlatform.SINA;
		mShareMedia = SHARE_MEDIA.SINA;
		mStyleList.add(StyleUtil.TEXT);
		mStyleList.add(StyleUtil.TEXTANDIMAGE);
		mStyleList.add(StyleUtil.IMAGELOCAL);
		mStyleList.add(StyleUtil.IMAGEURL);
		mStyleList.add(StyleUtil.WEB11);
		PlatformConfig.setSinaWeibo(XXConstants.appKeySinaWeibo, XXConstants.appSecretSinaWeibo, XXConstants.uriSecretSinaWeibo);
	}

	public void thirdShare(ShareData shareData) {
		// TODO Auto-generated method stub
		//shareData.mShareStyle = StyleUtil.VIDEO11;
		switch(shareData.mShareStyle){
			case StyleUtil.TEXT:
				 new ShareAction(mActivity).withText(Defaultcontent.text)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.TEXTANDIMAGE:
				 new ShareAction(mActivity).withText(Defaultcontent.text)
				 .withMedia(mImagelocal)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.IMAGELOCAL:
				 new ShareAction(mActivity).withMedia(mImagelocal)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.IMAGEURL:
				shareImage(shareData);
				break;
			case StyleUtil.WEB11:
				 new ShareAction(mActivity)
                 .withText(Defaultcontent.text)
                 .withMedia(mWeb)
                 .setPlatform(mShareMedia)
                 .setCallback(mUMThirdShareListener).share();
				break;
			case StyleUtil.VIDEO11:
			//	new ShareAction(mActivity).withMedia(mVideo)
			//			.setPlatform(mShareMedia)
			//			.setCallback(mUMThirdShareListener).share();
				shareVideo(shareData);
				break;
		}
	}

}
